<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Spread Your Word!</title>
        <h:outputStylesheet name="css/jsfcrud.css"/>
    </h:head>
    <h:body style="background-color: #90b4bd">
        <p:fieldset legend="Spread Your Word, #{myUserController.selected.firstName}">
            <h:panelGrid  columns="2" cellpadding="10">
                <p:graphicImage value="resources/images/shareEvent.gif" />
                <p:fieldset legend="Tell My Friends">
                    <h4>Choose From Social Networks</h4>
                    <p:graphicImage value="resources/images/facebookIcon.png" >                                
                    </p:graphicImage> &nbsp;
                    <p:graphicImage value="resources/images/twitterIcon.png" >                                
                    </p:graphicImage> &nbsp;
                    <p:graphicImage value="resources/images/googleplusIcon.png" >                                
                    </p:graphicImage>
                    <h4>or Manually:</h4>
                    <h:form>
                        <p:dataTable value="#{friendTableBean.friends}" var="friend" id="friendsTable">
                            <p:column>
                                <f:facet name="header" >
                                    <h:outputLabel  value="First Name"/>
                                </f:facet>
                                <h:inputText id="firstName" value="#{friend.firstName}" title="#{bundle.CreateMyUserTitle_firstName}" />
                            </p:column>
                            <p:column>
                                <f:facet name="header" >
                                    <h:outputLabel  value="Last Name"/>
                                </f:facet>
                                <h:inputText id="lastName" value="#{friend.lastName}" title="#{bundle.CreateMyUserTitle_lastName}" />
                            </p:column>
                            <p:column>
                                <f:facet name="header" >
                                    <h:outputLabel  value="E-Mail" />
                                </f:facet>
                                <h:inputText id="userName" value="#{friend.userName}" title="#{bundle.CreateMyUserTitle_userName}" 
                                             validator="emailValidator"/>
                            </p:column>
                            <f:facet name="footer" >
                                <p:commandLink value="Click to add one more friend" actionListener="#{friendTableBean.enlargeList}" update="friendsTable"/>
<!--                                <p:messages />-->
                            </f:facet>
                        </p:dataTable>
                        <br />
                        <h:panelGroup style="display:block; text-align:center">
                            <p:commandButton ajax="false" action="#{spreadPageController.createFriendAndTicket()}" value="Send" />
                        </h:panelGroup>
                    </h:form>
                </p:fieldset>                
            </h:panelGrid>
        </p:fieldset>
    </h:body>

</html>

